package com.zf.common.core.constants;

import java.time.format.DateTimeFormatter;

/**
 * 基本常量
 */
public class BasicConstants {
    public static final String TRACE_ID = "TRACE_ID";

    public static final String SEPARATOR = "<||>";

    public static final String COMMA = ",";
    public static final String SEMICOLON = ";";
    public static final String PIPE = "|";
    public static final String DOT = ".";
    public static final String DASH = "-";
    public static final String SLASH = "/";

    public static final String DASH_YYYY_MM_DD = "yyyy-MM-dd";
    public static final String NO_SEPARATOR_YYYY_MM_DD = "yyyyMMdd";
    public static final String SLASH_YYYY_MM_DD = "yyyy/MM/dd";
    public static final DateTimeFormatter DASH_YYYY_MM_DD_FORMATTER_8 = DateTimeFormatter.ofPattern(DASH_YYYY_MM_DD);
    public static final DateTimeFormatter NO_SEPARATOR_YYYY_MM_DD_FORMATTER_8 = DateTimeFormatter.ofPattern(NO_SEPARATOR_YYYY_MM_DD);
    public static final DateTimeFormatter SLASH_YYYY_MM_DD_FORMATTER_8 = DateTimeFormatter.ofPattern(SLASH_YYYY_MM_DD);


    /**
     * 0或正整数 正则表达式
     */
    public static final String ZERO_POSITIVE_INTEGER_REGEX = "\\d+";
    /**
     * 正整数 正则表达式，零开头也能匹配
     */
    public static final String POSITIVE_INTEGER_REGEX = "0*[1-9]\\d*";
    /**
     * 日期正则表达式
     */
    public static final String DASH_YYYY_MM_DD_REGEX = "\\d{4}-\\d{2}-\\d{2}";
    public static final String NO_SEPARATOR_YYYY_MM_DD_REGEX = "\\d{8}";
    public static final String SLASH_YYYY_MM_DD_REGEX = "\\d{4}/\\d{2}/\\d{2}";

}
